<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no, date=no, address=no, email=no, url=no">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    {include file="Public:header" /}
    <title>首页</title>
    <meta name="description" content="">
    <link rel="stylesheet" href="__WECHATCSS__/main.css">
    <script type="text/javascript">
        (function (win, doc) {
            if (!win.addEventListener) return;
            var html = document.documentElement;
            function setFont() {
                var cliWidth = html.clientWidth;
                html.style.fontSize = 100 * (cliWidth / 750) + 'px';
            }
            win.addEventListener('resize', setFont, false);
            setFont();
        })(window, document);
    </script>
</head>

<body>
    <div class="container">
        <div class="head">
            <div class="PersonalImgNav">
                <div class="nav">
                    <img src="{$member_info.headimgurl}" />
                </div>
            </div>
            <div class="map-text">
                您所在位置<br />
                <p>{$storeInfo.name}</p>
            </div>
        </div>
        <form action="{:Url('Order/hire')}" method="GET">
            <div class="main">
                <h1>填写您的桌号</h1>
                <p>稍后会有专人为您办理</p>
                <br />
                <input type="hidden" name="store_id" value="{$storeInfo.id}">
                <input type="hidden" name="seat_id" value="{$seatInfo['id']}">
                <!-- <input class="tablenum" type="number" autocomplete="off" name="seat_num" value="{$seatInfo['seat_num']}"
                    onKeyUp="if(this.value.length>3 || ! /^\d+$/.test(this.value)) this.value=' ';this.className='tablenum';if(this.value.length>2)this.className='TableNum';"></input> -->
                <input class="tablenum" type="text" id="input_table" />
            </div>
            <button type="submit" class="submit">确&nbsp;定</button>
        </form>
    </div>
    <script src="__WECHATASSETS__/jquery.min.js"></script>
    <script src="__WECHATASSETS__/zepto.min.js"></script>
    <script src="__WECHATJS__/main.js"></script>
	{include file="Public:footer" /}

    <!-- 增加input输入控制 -->
    <script type="text/javascript">
            $(function() {
                var reg = /^[0-9a-zA-Z]+$/;

                function controllinput() {
                    if(!reg.test($('#input_table').val())) {
                        $('#input_table').val("");
                    } else {
                        if($('#input_table').val().length > 4) {
                            $('#input_table').val('');
                        } else {
                            $('#input_table').val($('#input_table').val());
                        }
                    }
                    if($('#input_table').val().length >= 3 && $('#input_table').val().length <= 4) {
                        $('#input_table').attr('class', 'TableNum');
                    }
                    if($('#input_table').val().length >= 0 && $('#input_table').val().length <= 2) {
                        $('#input_table').attr('class', 'tablenum');
                    }
                };
                $('#input_table').on('keyup', function() {
                    controllinput();
                });
                $('#input_table').on('blur', function() {
                    controllinput();
                })
            })
        </script>
</body>

</html>